Fluent Assertions Documentation
FluentAssertions.Equivalency Namespace / EquivalencyOptions<TExpectation> Class / WithMapping Method / WithMapping(String,String) Method
A field or property path indicating the (nested) member to map from in the format Parent.Child.Collection[].Member.
A field or property path indicating the (nested) member to map to in the format Parent.Child.Collection[].Member.
In This Topic
    WithMapping(String,String) Method
    In This Topic
    Maps a (nested) property or field of the expectation to a (nested) property or field of the subject using a path string.
    Syntax

    Parameters

    expectationMemberPath
    A field or property path indicating the (nested) member to map from in the format Parent.Child.Collection[].Member.
    subjectMemberPath
    A field or property path indicating the (nested) member to map to in the format Parent.Child.Collection[].Member.
    Remarks
    The members of the subject and the expectation must have the same parent. Also, indexes in collections are not allowed and must be written as "[]". If the types of the members are different, the usual logic applies depending or not if conversion options were specified. Fields can be mapped to properties and vice-versa.
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also